package com.sikaryofficial.qrcode.controller;

import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.qrcode.domain.dto.resp.QrCodeCountResp;
import com.sikaryofficial.qrcode.manager.ProductManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qinjinyuan
 * @description 统计二维码数据服务，支持内网统计
 * @date 2023-07-18 21:38
 **/
@Api(tags = "二维码概览服务")
@RestController
@RequestMapping("/overview")
@Slf4j
public class QrCoreOverviewController {
    @Autowired
    private ProductManager productManager;

    /**
     * 统计二维码数据
     * @return
     */
    @GetMapping("/statistics")
    @ApiOperation(value = "二维码统计")
    public R<QrCodeCountResp> countQrCodeData() {
        return R.ok(productManager.countQrCodeData());
    }
}
